<template>
  <v-table
    ref="table"
    :data="loadData"
    :columns="workCenter.columns"
  >
  </v-table>
</template>

<script>
import { fetchList } from '@/api/plan/workcenterplan'
import { TableMixin } from '@/mixins/TableMixin'
import { workCenter } from './template'
export default {
  name: 'work-center',
  mixins: [TableMixin],
  props: {
    planCode: {
      type: String,
      require: true
    }
  },
  data(){
    return {
      workCenter,
      loadData: parameter => {
        if(!this.planCode){
          return []
        }
        return fetchList(
          Object.assign(parameter, this.queryParam,{planCode: this.planCode})
        ).then(res => {
          return res.data
        })
      }
    }
  }
}
</script>

<style scoped>

</style>